home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Tools&Utilities / MathPad 2.4 / Documentation / Images < prev    next >
Text File  |  1996-03-10  |  5KB  |  53 lines

  1.  
  2. --------- Image display
  3. -- The "image" command can be used to display a 2D array. Each array element is displayed as a tile filled with a gray level (or color) corresponding to its value.
  4.  
  5.    A[ix,iy] = sin(ix*20) + sin(iy*10) dim[20,36]
  6.    image A
  7.  
  8. -- The entire array is displayed and fills the plot area regardless of the values of Xmin, Xmax, Ymin, or Ymax. These values can be set as desired to show whatever axis is appropriate for the data.
  9.  
  10.    Xmin=20; Xmax=400; Ymin=10; Ymax=360;  -- Label axis in degrees
  11.  
  12. -- The array is displayed "sideways" meaning that array element A[1,1] is displayed in the lower left corner. This convention results in a simple correspondence between an element A[ix,iy] and the plot x,y coordinate system.
  13.  
  14. -- The image command displays an array but any function can be converted to an array. To sample a function over some arbitrary range of x and y values you can scale array index values to generate the desired x and y values.
  15.  
  16.  
  17. ---------- Z scale
  18. -- Mapping of an element's numeric value to a gray level (or color) is controlled by special variables "Zmin" and "Zmax". Zmin and Zmax define the range of values that are of interest. Values at or above Zmax are displayed as the highest gray level (or color). Values at or below Zmin are displayed as the lowest gray level (or color). Missing data is always displayed as white.
  19.  
  20.    Zmin=-2; Zmax =2;
  21.  
  22. ---------- Auto ranging
  23. -- If Zmin and/or Zmax are not specified, MathPad will use Zlo and/or Zhi from the previous evaluation. This is similar to the way plots are auto-ranged except that the user must re-evaluate the document to get the new Z scale. This was done because of the time involved in evaluating an array twice. It seemed best to give the user another chance at setting the scale before evaluating again.
  24.  
  25. ---------- Display options
  26. -- The Image... menu item can be used to alter the appearance of the image to best fit your particular hardware and tastes. If your system does not support color Quickdraw the the only choice available is halftone patterns so you can pretty much ignore this menu. Otherwise, all the options are available though some may not be very useful on some systems. 
  27.  
  28. --   Halftone patterns
  29. --Data is displayed as differing black and white patterns. Choose this option if you have a black and white monitor and you prefer its appearance over dithered halftones.
  30.  
  31. --   gray levels
  32. -- Data is displayed as levels of gray. This is the obvious choice if you have a grayscale monitor. You may also prefer gray levels for data display even if you have a color monitor. An 8-bit color display will usually give about 16 different levels of gray when the monitor is set for color. If the monitor is set for gray levels you will get a full 256 levels.
  33.  
  34. --   color
  35. -- Data is displayed as differing colors. Values near Zmin are blue and range up through green and yellow to red at Zmax. For an 8-bit color display there are usually about 30 different colors in the scale. MathPad uses whatever colors are currently available and does not modify the screen's color table. This allows it to co-exist easily with other applications that use color.
  36.  
  37. --   dithering
  38. -- If this box is checked, intermediate gray levels or colors are created by mixing screen pixels of more than one color. This results in a smoother scale. The disadvantage is slower updating. Also dithering sometimes produces pattern artifacts in the image. Dithered gray levels can be used to produce halftone images on black and white screens.
  39.  
  40. ---------  Printing images
  41. -- Since your printer may not have the same capabilities as your screen, the image dialog is presented when you print a plot containing an image. Unless you have a color printer you will probably want to print the image as gray levels. If your printer driver does not support grayscale directly you will need to use dithering or halftone patterns.
  42.  
  43. ---------  Plot overlays
  44. -- The plot command can be used in conjunction with the image command. The plot will be drawn on top of the image.
  45.  
  46.    plot sin(X)*50+200  -- arbitrary scale to fit on existing Y axis
  47.  
  48. ---------  PICT overlays
  49. -- A PICT pasted into the plot goes on top of the image. If the PICT is a line drawing the image will be visible through the PICT but a bitmap will obscure the entire image.
  50.  
  51. ---------  Click info
  52. -- When the mouse is clicked on the image the corresponding X,Y and Z values are printed in the info line at the bottom of the plot. Since only the display information is saved, the Z value shown is approximate and will not show values outside of Zmin to Zmax. If the image has a plot overlay the mouse click will pick a nearby plot X,Y point over an image point.
  53.